package com.su.test;

import java.util.Scanner;

/**
 * @author Li
 * @Date 2023/4/7 15:18
 */
public class ScanArraySum {
    public static void main(String[] args) {
        /**
         * 键盘输入数组元素进行求和
         */

        int[] a=new int[5];
        int sum = 0;
        int max = 0;
        int even=0;
        for (int i = 0; i<a.length;i++){
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入第"+(i+1)+"个正整数");
            a[i] = scanner.nextInt();
        }
        for (int i=0;i<a.length;i++){
            sum+=a[i];
            max = max > a[i] ? max : a[i];
            if (a[i]%2==0){
                even+=a[i];
            }
        }
        System.out.println("数组和:"+sum);
        System.out.println("数组偶数"+even);
        System.out.println("数组中的最大值:"+max);
    }
}
